<%# form_tag('javascript:void(0)') do %>
<%#end %>

  <h1>New city</h1>

  <% form_for(@city) do |f| %>
    <%= f.error_messages %>

    <p>      
      <%= f.label :name %><br />
      <%= f.text_field :name %>
    </p>

    <p>
      <%= f.label :country %><br />
      <%= select_tag :country_filter, '<option value="-1"selected="selected">Por favor seleccione</option>' +
          options_from_collection_for_select( @countries, :id, :name ) %>
      
      <%= observe_field :country_filter,
                        :update    => 'city_states',
                        :url       => {:controller =>'cities', :action=>'get_country_states', :only_path => false},
                        :with      => "'country_id=' +value" %>
    </p>

    <p id="city_states">
        <%= render :partial=>'update_states' %>
    </p>
    <p>
      <%= f.submit 'Create' %>
    </p>
  <% end %>

  <%= link_to 'Back', cities_path %>
